
<%@ page import="br.unicarioca.viaexpositus.Organizacao" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'organizacao.label', default: 'Organizacao')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
     	
        <div class="body">
            <div>
            	<h1><g:message code="default.edit.label" args="[entityName]" /></h1>
		        <div class="buttonsBar">
		            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
		            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
		        </div>
		        <div class="clear"></div>
	    	</div>    

            <div class="clear" >&nbsp;</div>

            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>

            <g:hasErrors bean="${organizacaoInstance}">
                <div class="errors">
                    <g:renderErrors bean="${organizacaoInstance}" as="list" />
                </div>
            </g:hasErrors>

            <g:form method="post" >
                <fieldset>
                  <legend>Organiza&ccedil;&atilde;o</legend>
                  <div class="dialog">
                      <g:hiddenField name="id" value="${organizacaoInstance?.id}" />
                      <g:hiddenField name="version" value="${organizacaoInstance?.version}" />
                      <table>
                          <tbody>
                              <tr class="prop">
                                  <td valign="top" class="name">
                                    <label for="nome"><g:message code="organizacao.nome.label" default="Nome" /></label>
                                  </td>
                                  <td valign="top" class="value ${hasErrors(bean: organizacaoInstance, field: 'nome', 'errors')}">
                                      <g:textField name="organizacao.nome" value="${organizacaoInstance?.nome}" />
                                  </td>
                              </tr>
                              <tr class="prop">
                                  <td valign="top" class="name">
                                    <label for="cidade"><g:message code="organizacao.cidade.label" default="Cidade" /></label>
                                  </td>
                                  <td valign="top" class="value ${hasErrors(bean: organizacaoInstance, field: 'cidade', 'errors')}">
                                      <g:textField name="cidade" value="${organizacaoInstance?.cidade}" />
                                  </td>
                              </tr>
                              <tr class="prop">
                                  <td valign="top" class="name">
                                    <label for="estado"><g:message code="organizacao.estado.label" default="Estado" /></label>
                                  </td>
                                  <td valign="top" class="value ${hasErrors(bean: organizacaoInstance, field: 'estado', 'errors')}">
                                      <g:select name="estado.id" from="${br.unicarioca.viaexpositus.Estado.list()}" optionKey="id" value="${organizacaoInstance?.estado?.id}"  />
                                  </td>
                              </tr>
                              <tr class="prop">
                                  <td valign="top" class="name">
                                    <label for="telefone"><g:message code="organizacao.telefone.label" default="Telefone" /></label>
                                  </td>
                                  <td valign="top" class="value ${hasErrors(bean: organizacaoInstance, field: 'telefone', 'errors')}">
                                      <g:textField name="telefone" value="${organizacaoInstance?.telefone}" />
                                  </td>
                              </tr>
                              <tr class="prop">
                                  <td valign="top" class="name">
                                    <label for="cnpj"><g:message code="organizacao.cnpj.label" default="Cnpj" /></label>
                                  </td>
                                  <td valign="top" class="value ${hasErrors(bean: organizacaoInstance, field: 'cnpj', 'errors')}">
                                      <g:textField name="cnpj" value="${organizacaoInstance?.cnpj}" />
                                  </td>
                              </tr>
                              <tr class="prop">
                                  <td valign="top" class="name">
                                    <label for="endereco"><g:message code="organizacao.endereco.label" default="Endereco" /></label>
                                  </td>
                                  <td valign="top" class="value ${hasErrors(bean: organizacaoInstance, field: 'endereco', 'errors')}">
                                      <g:textField name="endereco" value="${organizacaoInstance?.endereco}" />
                                  </td>
                              </tr>
                          </tbody>
                      </table>

                  </div>
                </fieldset>
                <fieldset>
                  <legend>Usu&aacute;rio administrador</legend>
                    <div class="dialog">
                        <g:hiddenField name="id" value="${usuarioInstance?.id}" />
                        <g:hiddenField name="version" value="${usuarioInstance?.version}" />
                        <table>
                            <tbody>
                                <tr class="prop">
                                    <td valign="top" class="name">
                                      <label for="nome"><g:message code="usuario.nome.label" default="Nome" /></label>
                                    </td>
                                    <td valign="top" class="value ${hasErrors(bean: usuarioInstance, field: 'nome', 'errors')}">
                                        <g:textField name="usuario.nome" value="${usuarioInstance?.nome}" />
                                    </td>
                                </tr>
                                <tr class="prop">
                                    <td valign="top" class="name">
                                      <label for="email"><g:message code="usuario.email.label" default="Email" /></label>
                                    </td>
                                    <td valign="top" class="value ${hasErrors(bean: usuarioInstance, field: 'email', 'errors')}">
                                        <g:textField name="email" value="${usuarioInstance?.email}" />
                                    </td>
                                </tr>
                                <tr class="prop">
                                    <td valign="top" class="name">
                                      <label for="senha"><g:message code="usuario.senha.label" default="Senha" /></label>
                                    </td>
                                    <td valign="top" class="value ${hasErrors(bean: usuarioInstance, field: 'senha', 'errors')}">
                                        <g:textField name="senha" value="${usuarioInstance?.senha}" />
                                    </td>
                                </tr>
                                <tr class="prop">
                                    <td valign="top" class="name">
                                      <label for="confirmacaoSenha"><g:message code="usuario.confirmacaoSenha.label" default="Confirmacao Senha" /></label>
                                    </td>
                                    <td valign="top" class="value ${hasErrors(bean: usuarioInstance, field: 'confirmacaoSenha', 'errors')}">
                                        <g:textField name="confirmacaoSenha" value="${usuarioInstance?.confirmacaoSenha}" />
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </fieldset>
                <div class="buttons">
                	<g:if test="${organizacaoInstance.id}">
                    	<span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.save.label', default: 'Save')}" /></span>
                    </g:if>
                    <g:else>
                    	<span class="button"><g:actionSubmit class="save" action="save" value="${message(code: 'default.button.save.label', default: 'Save')}" /></span>	
                    </g:else>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
